home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / lib / Math.sig < prev    next >
Encoding:
Text File  |  1997-08-18  |  2.2 KB  |  75 lines  |  [TEXT/Moml]

  1. (* Math -- SML Basis Library *)
  2.  
  3. type real = real
  4.  
  5. val pi : real
  6. val e  : real
  7.  
  8. val sqrt  : real -> real
  9. val sin   : real -> real
  10. val cos   : real -> real
  11. val tan   : real -> real
  12. val atan  : real -> real
  13. val asin  : real -> real
  14. val acos  : real -> real
  15. val atan2 : real * real -> real
  16. val exp   : real -> real
  17. val pow   : real * real -> real
  18. val ln    : real -> real
  19. val log10 : real -> real
  20. val sinh  : real -> real
  21. val cosh  : real -> real
  22. val tanh  : real -> real
  23.  
  24. (*  
  25.    [pi] is the circumference of the circle with diameter 1: 
  26.    3.14159265358979323846.
  27.  
  28.    [e] is the base of the natural logarithm: 2.7182818284590452354.
  29.  
  30.    [sqrt x] is the square root of x.  Raises Domain is x < 0.0.
  31.  
  32.    [sin r] is the sine of r, where r is in radians.
  33.  
  34.    [cos r] is the cosine of r, where r is in radians.
  35.  
  36.    [tan r] is the tangent of r, where r is in radians.  Raises Domain if 
  37.    r is a multiple of pi/2.
  38.  
  39.    [atan t] is the arc tangent of t, in the open interval ] ~pi/2, pi/2 [.
  40.  
  41.    [asin t] is the arc sine of t, in the closed interval [ ~pi/2, pi/2 ].  
  42.    Raises Domain if abs x > 1.
  43.  
  44.    [acos t] is the arc cosine of t, in the closed interval [ 0, pi ].
  45.    Raises Domain if abs x > 1.
  46.  
  47.    [atan2(y, x)] is the arc tangent of y/x, in the interval ] ~pi, pi ],
  48.    except that atan2(y, 0) = sign y * pi/2.  The quadrant of the result
  49.    is the same as the quadrant of the point (x, y).
  50.    Hence sign(cos(atan2(y, x))) = sign x 
  51.    and   sign(sin(atan2(y, x))) = sign y. 
  52.  
  53.    [exp x] is e to the x'th power.
  54.  
  55.    [pow (x, y)] is x it the y'th power, defined when 
  56.       y >= 0 and (y integral or x >= 0)
  57.    or y < 0 and ((y integral and x <> 0.0) or x > 0).
  58.  
  59.    We define pow(0, 0) = 1.
  60.  
  61.    [ln x] is the natural logarithm of x (that is, with base e).
  62.    Raises Domain if x <= 0.0.
  63.  
  64.    [log10 x] is the base-10 logarithm of x.  Raises Domain if x <= 0.0.
  65.  
  66.    [sinh x] returns the hyperbolic sine of x, mathematically defined as
  67.    (exp x - exp (~x)) / 2.  Raises Overflow if x is too large.
  68.  
  69.    [cosh x] returns the hyperbolic cosine of x, mathematically defined as
  70.    (exp x + exp (~x)) / 2.  Raises Overflow if x is too large.
  71.  
  72.    [tanh x] returns the hyperbolic tangent of x, mathematically defined 
  73.    as (sinh x) / (cosh x).  Raises Domain if x is too large.
  74. *)
  75.